C NOTE: Read the "MPW Fortrans" section of "About Compilers"
C before compiling LF programs that use FaceWare modules.

C Tutorial LF Demonstration Program
C ©FaceWare 1993.  All Rights Reserved.

!!M Inlines.f
!!I FaceProcLF.inc

      PROGRAM TutorialLF
	implicit none
C NOTE: If you use the "!!G" directive for precompiled globals, add
C our FaceStorLF.inc globals to yours and then remove following line
	include 'FaceStorLF.inc'
      record /FaceRec/ fRec
      common/FaceStuff/fRec
	integer*2 theFlag,theListItem,theMenuItem
	character*32 theString

      fRec.uName = 'Tutorial.Rsrc'
      call FaceIt(0,DoInit,0,0,0,0)
	theFlag = 0
	theListItem = 3
	theMenuItem = 2
	theString = 'Hello'

      do while (.true.)
        call FaceIt(0,DoLoop,0,0,0,0)
	  if ((fRec.uMenuID = 105).and.(fRec.uMenuItem = 1)) then
	    call FaceIt(0,NewWnd,1010,0,0,0)
	    call FaceIt(0,GetCtl,1010,0,1,3)
	    call FaceIt(0,LnkCtl,fRec.cControl,%loc(theFlag),2,0)
	    call FaceIt(0,GetCtl,1010,0,1,4)
	    call FaceIt(0,LnkCtl,fRec.cControl,%loc(theString),-31,0)
	    call FaceIt(0,GetCtl,1010,0,1,5)
	    call FaceIt(0,LnkCtl,fRec.cControl,%loc(theListItem),2,0)
	    call FaceIt(0,GetCtl,1010,0,1,6)
	    call FaceIt(0,LnkCtl,fRec.cControl,%loc(theMenuItem),2,0)
	    call FaceIt(0,SetVal,1010,0,0,0)
	    do while (.true.)
	      call FaceIt(0,MdlWnd,1010,0,0,0)
		if (fRec.uMenuID = 1010) then
		  if (fRec.wcHit = -1) then
		    exit
		  else if (fRec.wcHit = 1) then
		    call FaceIt(0,GetVal,1010,0,0,0)
		    exit
		  else if (fRec.wcHit = 2) then
		    call FaceIt(0,GetCtl,1010,0,1,8)
		    fRec.uString = 'Run button was hit.'
		    call FaceIt(fRec.cControl,1565,2,0,0,0)
		  end if
		end if
	    end do
	    call FaceIt(0,EndWnd,1010,0,0,0)
	  end if
	end do
	end
